package dq.study.designmodel.state;

/**
 * @author dongqun
 * @Description:
 * @date 2019/4/19 23:17
 */
public class Client {

    public static void main(String[] args){
        State state = new SpecialState1();
        Context context = new Context(state);
        //设置第一种状态
        // 正常执行
        state.setValue("state1");
        context.method();
        //设置第二种状态
        // state不满足,抛出异常
        state.setValue("state2");
        context.method();
    }
}
